Show minor edits - Show changes to output
Well, shall we?
OK, first off i'll do a simple 'shoot at this until i say so' thing. Sounds fun huh?
OK, well make a small outdorsie map (mine was basically a skybox with ground texture at the bottom with a shooting range wall at the far end. I wacked in an info_player_start and a couple friendly soldiers. For them i plunked in targetnames of $shooter1 and $shooter2
OK, enough about me. Make a couple script_origins where you want teh poor wall to be slaughtered at. That's where the bullets'll go. taht's just for an aiming spot :)
OK, well: give them a targetname. I generally give them stuff like $shootspot_1 and so on. just so i know. ;)
Alright, make sure your AI are positioned close enough, and SCRIPT!
So put the following in the script file....
----
main:
exec global/ai.scr
level waittill prespawn
level waittill spawn
thread stupid_wall
end
stupid_wall:
$player item weapon/colt45.tik
$player ammo pistol 200
wait 10
$shooter1 ai_off
$shooter2 ai_off
$shooter1 exec global/aim_and_shoot.scr $shootspot_1.origin
$shooter2 exec global/aim_and_shoot.scr $shootspot_1.origin
wait 20
iprintlnbold_noloc "i think it's dead."
$shooter1 ai_on
$shooter2 ai_on
wait 3
$shooter1 kill
$shooter2 kill
iprintlnbold_noloc "so are they..."
end
----
OK OK, so the end was mean.
Anyway, the key part is the "$shooter1 exec global/aim_and_shoot.scr $shootspot_1.origin" line. That tells him to aim, wait a sec, then start shooting. That simple.
Alright, what about grenades? Surely they can do some concentrated grenade throwing?
Sure.
OK, do the same thing. Make script_objects and give them targetnames and get your AI set up. I made mine to throw the grenades over a small wall and into kinda basketball hoops. Whateer you want tho ;)
The scripting is EXTREMELY easy. Just like the last one. In fact, just replace the
----
$shooter1 exec global/aim_and_shoot.scr
$shootspot_1.origin
----
with
----
$shooter1 exec global/try_throw_grenade.scr
$shootspot_1.origin
----
Thats it. They will toss it so that the top of the arc hits the origin. real simple huh?
Well OK, now you hopefully know how to make the AI do gun tricks. Congrats. This is especially useful for large mock battles and even better, supressing fire.
Cheers,
[[Profile/reptilian_mapper]]